<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>

<%
            request.setAttribute("nombrePagina", "Nuevo Usuario");
%>

<f:view>

    <%@include file="/WEB-INF/jspf/cabeceraSeguridad.jspf" %>

    <h:messages styleClass="messages_content"
                layout="table"
                errorClass="errorClass"
                warnClass="warnClass"
                infoClass="infoClass" />

    <h:form>
        <h1>Nuevo Usuario</h1>

        <h:panelGrid columns="3" columnClasses="label,input,derecha" >

            <h:outputLabel value="Persona: " for="Persona" />
            <h:inputText id="Persona" value="#{iu.usuario.persona.apellidoPaterno} #{iu.usuario.persona.apellidoMaterno} #{iu.usuario.persona.nombres}" size="30" readonly="true" />
            <h:commandLink id="btnSeleccionarPersona"
                           accesskey="B"
                           value="Buscar Persona"
                           styleClass="btn"
                           action="listarPersonas" />


            <h:outputLabel value="Login: " for="txtLogin" />
            <h:inputText id="txtLogin" value="#{iu.usuario.login}" maxlength="30" size="30" />
            <h:panelGroup/>

            <h:outputLabel value="Password: " for="txtPassword" />
            <h:inputSecret id="txtPassword" value="#{iu.usuario.password}" maxlength="30" size="30"  />
            <h:panelGroup/>

            <h:panelGroup/>
            <h:panelGroup/>
            <br/>

            <h:panelGroup/>
            <h:panelGroup>

                <h:commandLink id="btnGuardar"
                               accesskey="G"
                               value="Guardar"
                               styleClass="btn"
                               action="#{iu.registrar}" />
                <h:commandLink id="btnCancelar"
                               accesskey="C"
                               value="Cancelar"
                               styleClass="btn"
                               action="#{iu.volver}" />

            </h:panelGroup>
            <h:panelGroup/>

        </h:panelGrid>

    </h:form>

    <%@include  file="/WEB-INF/jspf/pie.jspf" %>

</f:view>
